package de.rs.espresso.algorithms.minimumcover.model;

import java.util.ArrayList;
import java.util.List;

public class Column<T> {

	private int columnNumber;
	private T element;
	
	public Column(T element, int columnNumber) {
		this.element = element;
		this.columnNumber = columnNumber;
	}

	public int getPosition() {
		return columnNumber;
	}

	public T getElement() {
		return element;
	}
	
	
	public static <T> List<Column<T>> toColumnList(List<T> columns) {
		List<Column<T>> result = new ArrayList<Column<T>>();
		
		int columnNumber = 0;
		for(T c : columns) {
			result.add(new Column(c, columnNumber));
			columnNumber++;
		}
		
		return result;
		
	}
	
}
